﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="BookChapterListModule.ascx.cs" 
    Inherits="ChapterX.Modules.BookChapterListModule" %>

<%@ Import Namespace="ChapterX.BusinessFacade" %>
<%@ Import Namespace="ChapterX.Common" %>

<div class="data-list-wrapper">
    <asp:HiddenField ID="hf_bookId" runat="server" />
    <asp:Repeater ID="rp_ChapterList" runat="server">
        <HeaderTemplate>
            <table class="data-list">
                <thead>
                     <tr>
                        <td>序号</td>
                        <td>标题</td>
                        <td>简介</td>
                        <td>上传时间</td>
                        <% if (CurrentUserInfo.IsLibrarian)
                           { %>
                            <td>管理</td>
                        <%} %>
                        
                    </tr>
                </thead>
                <tbody>
        </HeaderTemplate>
        <ItemTemplate>
                    <tr>
                        <td><%# Eval("Seq") %><asp:HiddenField ID="hf_ChpapterId" runat="server" /></td>
                        <td>
                             <asp:HyperLink ID="hl_File" runat="server" Text='<%# Eval("Title") %>' 
                             NavigateUrl='<%# "~/files/book-chapters/" + Eval("BookId") + "/" + Eval("FilePath") %>' >
                             </asp:HyperLink>
                        </td>
                        <td><%# Eval("Descs") %></td>
                        <td><%# Eval("SubmitTime") %></td>
                        <% if (CurrentUserInfo.IsLibrarian)
                           { %>
                        <td>
                            <asp:HyperLink ID="hl_Edit" runat="server" Text="修改" NavigateUrl='<%# 
                            String.Format("{0}?{1}={2}&{3}={4}", DataNavigateUrl, QueryKeys.CHAPTER_ID, Eval("ChapterId"), QueryKeys.BOOK_ID, Eval("BookId")) %>'></asp:HyperLink>
                            <asp:Button ID="btn_Del" runat="server" Text="删除" />
                        </td>
                        <% } %>
                    </tr>
        </ItemTemplate>
        <FooterTemplate>
                </tbody>
            </table>
        </FooterTemplate>
    </asp:Repeater>
</div>
